package com.java.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.java.po.Root;
import com.java.service.RootService;
import com.java.service.impl.RootServiceImpl;
import com.java.tool.AjaxJson;

/**
 * Title:RootController.java
 * Description:
 * @author:sprogrammer
 * @time:2018年2月22日下午7:42:12
 */
@Controller
@CrossOrigin()
@RequestMapping(method=RequestMethod.POST)
public class RootController {
	
	private AjaxJson ajaxJson;
	@Autowired
	private RootService service;
	
	@RequestMapping(value="/Rootlogin")
	public @ResponseBody AjaxJson login(@RequestBody Root root) throws Exception{
		ajaxJson= service.LoginRoot(root);
		return ajaxJson;
	}
	@RequestMapping(value="/FindRootByName")
	public @ResponseBody AjaxJson FindRootByName(@RequestBody Root root) throws Exception{
		//RootService service = new RootServiceImpl();
		ajaxJson = service.findRootByName(root);
		return ajaxJson;
	}
	
	
}
